import request from '@/utils/request'
import {SysDictTypeParams, SysDictTypeQuery} from "@/common/interface/dict/type.ts";

// 查询字典类型列表
export function listDictType(query: SysDictTypeQuery) {
    return request({
        url: '/system/dict/type/list',
        method: 'get',
        params: query
    })
}

// 查询所有字典类型列表
export function listAllDictType() {
    return request({
        url: '/system/dict/type/listAll',
        method: 'get'
    })
}

// 查询字典类型详细
export function getDictType(id: number) {
    return request({
        url: '/system/dict/type/' + id,
        method: 'get'
    })
}

// 新增字典类型
export function addDictType(data: SysDictTypeParams) {
    return request({
        url: '/system/dict/type',
        method: 'post',
        data: data
    })
}

// 修改字典类型
export function updateDictType(data: SysDictTypeParams) {
    return request({
        url: '/system/dict/type',
        method: 'put',
        data: data
    })
}

// 删除字典类型
export function delDictType(id: number[]) {
    return request({
        url: '/system/dict/type/' + id,
        method: 'delete'
    })
}
